export const test = {
	methods: {
		//查看详情
		testDetail(id) {
			this.$common.navigateTo(this.$ph.detail + `?id=${id}`)
		}
	},
}

export const order = {
	methods: {
		//查看详情
		getOrderDetail(type) {
			this.$api.order_detail({
				order_id: this.orderId
			}).then(res => {
				if (res.code && res.data.test_id) {
					if (type == 'pay') {
						this.$common.navigateTo(this.$ph.test + `?test_id=${res.data.test_id}`)
					} else {
						this.$common.navigateTo(this.$ph.success + `?test_id=${res.data.test_id}`)
					}
				} else {
					this.$common.navigateTo(this.$ph.mytest)
				}
			})
		}
	},
}
/**
 * 工具函数
 */

export const tools = {
	methods: {
		copyData(data) {
			var _this = this;
			uni.setClipboardData({
				data: data,
				success: function() {
					_this.$common.errorToShow('复制成功')
				}
			});
		}
	}
}
